package org.dzq.designmode.builder;

/**
 * @ClassName: Director
 * @Package: org.dzq.designmode.builder
 * @author: 越
 * @date: 2023/6/13 21:08
 * @Description: 角色：指挥者
 */
public class Director {

    private Builder builder;

    public Director(Builder builder){
        this.builder = builder;
    }

    public Cake constructFruitCake(){
        return this.builder.setCake(new Cake()).addFruit().addCream().addCrust().buildCake();
    }

    public Cake constructChocolateCake(){
        return this.builder.setCake(new Cake()).addChocolate().addCream().addCrust().buildCake();
    }

    public Cake constructTiramisuCake(){
        return this.builder.setCake(new Cake()).addCocoaPowder().addCoffeeWine().addCheese().addCream().addCrust().buildCake();
    }
}
